From 8db6ec34182f838ed2058b5ae950b628eacff039 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Wed, 18 Jul 2018 20:01:06 -0400 Subject: [PATCH] kfest: clear screen works --- kfest2018/raster.s | 58 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 52 insertions(+), 6 deletions(-) diff --git a/kfest2018/raster.s b/kfest2018/raster.s index 911236c9..b4746184 100644 --- a/kfest2018/raster.s +++ b/kfest2018/raster.s @@ -1,5 +1,8 @@ ; Kansasfest HackFest Entry +; Zero Page +DRAW_PAGE = $EE + ; Soft Switches SET_GR = $C050 ; Enable graphics @@ -20,26 +23,69 @@ HOME = $FC58 ;; Clear the text screen jsr TEXT jsr HOME + lda #0 + sta DRAW_PAGE + ; GR part bit LORES bit SET_GR bit FULLGR - lda #$55 - ldx #39 -border_loop: - sta $5d0,X ; 38 + ; Clear Page0 + + lda #$00 + ldy #46 +clear_page0_loop: + jsr hline + dey + dey + bpl clear_page0_loop + + ; Clear Page1 + + + + + lda #$55 + ldy #38 + jsr hline + - dex - bpl border_loop loop_forever: jmp loop_forever + ;================================== + ; HLINE + ;================================== + + ; Color in A + ; X has which line +hline: + ldx gr_offsets,y ; 4+ + stx hline_loop+1 ; 4 + ldx gr_offsets+1,y ; 4+ + stx hline_loop+2 ; 4 + ldx #39 ; 2 +hline_loop: + sta $5d0,X ; 38 ; 5 + dex ; 2 + bpl hline_loop ; 2nt/3 + rts ; 6 + + + + ; H E L L O .byte $D1,$00,$D1,$00, $D1,$01,$00, $D1,$00,$00, $D1,$00,$00, $D0,$01,$D0,$00 .byte $24,$04,$24,$00, $24,$20,$00, $24,$20,$00, $24,$20,$00, $04,$20,$04,$00 .byte $C9,$C0,$C9,$00, $C9,$C0,$00, $C9,$00,$00, $C9,$00,$00, $C9,$00,$C0,$00 .byte $06,$00,$06,$00, $06,$00,$00, $06,$00,$00, $06,$00,$00, $06,$00,$06,$00 + ; move these to zero page for slight speed increase? + +gr_offsets: + .word $400,$480,$500,$580,$600,$680,$700,$780 + .word $428,$4a8,$528,$5a8,$628,$6a8,$728,$7a8 + .word $450,$4d0,$550,$5d0,$650,$6d0,$750,$7d0