From 3e6284b135ba4b9528ad14d7208f9bff13f6ac38 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Mon, 17 Feb 2020 14:33:26 -0500 Subject: [PATCH] vs: mostly working --- vertical_scroll/gr_copy_large.s | 95 ++++++++++++++++++++++++++++++++- vertical_scroll/scroller.s | 46 ++++++++++++++-- vertical_scroll/zp.inc | 1 + 3 files changed, 137 insertions(+), 5 deletions(-) diff --git a/vertical_scroll/gr_copy_large.s b/vertical_scroll/gr_copy_large.s index 4d3ab49a..1358ddc0 100644 --- a/vertical_scroll/gr_copy_large.s +++ b/vertical_scroll/gr_copy_large.s @@ -1,7 +1,8 @@ ;========================================================= ; gr_copy_to_current, large, 40x48 version + ; for scrolling ;========================================================= - ; copy A000 to DRAW_PAGE + ; copy linear image at A000 to DRAW_PAGE ; gr_copy_to_current_large: @@ -39,6 +40,36 @@ gr_copy_to_current_large: ;=========== ; 45 + ; self modify source address + + ldx #0 +smc_loop: + ; line 0 + lda OUTH + sta gr_copy_line_large+2,X + lda OUTL + sta gr_copy_line_large+1,X + + ; line 1 + clc + adc #$28 ; 16 bit add + sta OUTL + lda OUTH + adc #$0 + sta OUTH + + inx + inx + inx + inx + inx + inx + + cpx #48 + bne smc_loop + + + ldy #39 ; for early ones, copy 120 bytes ; 2 gr_copy_line_large: @@ -71,6 +102,36 @@ gr_copy_line_large: + + ; self modify source address + + ldx #0 +smc_loop2: + ; line 0 + lda OUTH + sta gr_copy_line_large2+2,X + lda OUTL + sta gr_copy_line_large2+1,X + + ; line 1 + clc + adc #$28 ; 16 bit add + sta OUTL + lda OUTH + adc #$0 + sta OUTH + + inx + inx + inx + inx + inx + inx + + cpx #48 + bne smc_loop2 + + ldy #39 ; for early ones, copy 120 bytes ; 2 gr_copy_line_large2: @@ -102,6 +163,38 @@ gr_copy_line_large2: bpl gr_copy_line_large2 ; ; 2nt/3 + + + ; self modify source address + + ldx #0 +smc_loop3: + ; line 0 + lda OUTH + sta gr_copy_line_large3+2,X + lda OUTL + sta gr_copy_line_large3+1,X + + ; line 1 + clc + adc #$28 ; 16 bit add + sta OUTL + lda OUTH + adc #$0 + sta OUTH + + inx + inx + inx + inx + inx + inx + + cpx #48 + bne smc_loop3 + + + ldy #39 ; for early ones, copy 120 bytes ; 2 gr_copy_line_large3: diff --git a/vertical_scroll/scroller.s b/vertical_scroll/scroller.s index e7b423c3..4bd0d2a5 100644 --- a/vertical_scroll/scroller.s +++ b/vertical_scroll/scroller.s @@ -70,15 +70,53 @@ lda #$a0 jsr load_rle_large - jsr gr_copy_to_current_large ; copy to page1 +rescroll: + + lda #0 + sta SCROLL_COUNT + + lda #<$A000 + sta OUTL + sta INL + lda #>$A000 + sta OUTH + sta INH + + ; delay + lda #200 + jsr WAIT + +scroll_loop: + + jsr gr_copy_to_current_large ; copy to page1 jsr page_flip + +sl2: + lda INL ; inc to next line + clc + adc #$28 + sta INL + sta OUTL + lda INH + adc #$0 + sta INH + sta OUTH + + lda #100 + jsr WAIT + + inc SCROLL_COUNT + lda SCROLL_COUNT + + cmp #72 + bne scroll_loop + + jsr wait_until_keypress - - - + jmp rescroll forever: jmp forever diff --git a/vertical_scroll/zp.inc b/vertical_scroll/zp.inc index 2c5912c1..97e3a30d 100644 --- a/vertical_scroll/zp.inc +++ b/vertical_scroll/zp.inc @@ -70,6 +70,7 @@ PT3_TEMP = $8A DISP_PAGE = $ED ; ALL DRAW_PAGE = $EE ; ALL +SCROLL_COUNT = $F9 TEMP = $FA TEMPY = $FB INL = $FC