2018-07-18 13:27:26 +00:00
|
|
|
; Kansasfest HackFest Entry
|
|
|
|
|
2018-07-19 00:01:06 +00:00
|
|
|
; Zero Page
|
|
|
|
DRAW_PAGE = $EE
|
|
|
|
|
2018-07-18 21:13:33 +00:00
|
|
|
; Soft Switches
|
|
|
|
|
|
|
|
SET_GR = $C050 ; Enable graphics
|
|
|
|
FULLGR = $C052 ; Full screen, no text
|
|
|
|
LORES = $C056 ; Enable LORES graphics
|
|
|
|
|
|
|
|
|
|
|
|
; ROM routines
|
|
|
|
|
2018-07-18 13:40:37 +00:00
|
|
|
TEXT = $FB36 ;; Set text mode
|
|
|
|
HOME = $FC58 ;; Clear the text screen
|
2018-07-18 13:27:26 +00:00
|
|
|
|
|
|
|
|
2018-07-18 21:13:33 +00:00
|
|
|
|
2018-07-18 13:27:26 +00:00
|
|
|
;===================
|
|
|
|
; init screen
|
|
|
|
|
2018-07-18 13:40:37 +00:00
|
|
|
jsr TEXT
|
|
|
|
jsr HOME
|
2018-07-18 13:27:26 +00:00
|
|
|
|
2018-07-19 00:01:06 +00:00
|
|
|
lda #0
|
|
|
|
sta DRAW_PAGE
|
|
|
|
|
2018-07-18 21:13:33 +00:00
|
|
|
; GR part
|
|
|
|
bit LORES
|
|
|
|
bit SET_GR
|
|
|
|
bit FULLGR
|
|
|
|
|
2018-07-19 00:01:06 +00:00
|
|
|
; Clear Page0
|
|
|
|
lda #$00
|
2018-07-19 00:09:23 +00:00
|
|
|
sta DRAW_PAGE
|
|
|
|
jsr clear_gr
|
2018-07-19 00:01:06 +00:00
|
|
|
|
2018-07-19 00:09:23 +00:00
|
|
|
; draw border line
|
2018-07-19 00:01:06 +00:00
|
|
|
|
|
|
|
lda #$55
|
|
|
|
ldy #38
|
|
|
|
jsr hline
|
|
|
|
|
2018-07-19 00:09:23 +00:00
|
|
|
; Clear Page1
|
|
|
|
lda #$4
|
|
|
|
sta DRAW_PAGE
|
|
|
|
jsr clear_gr
|
2018-07-18 21:13:33 +00:00
|
|
|
|
2018-07-19 00:09:23 +00:00
|
|
|
; draw border line
|
2018-07-18 21:13:33 +00:00
|
|
|
|
2018-07-19 00:09:23 +00:00
|
|
|
lda #$55
|
|
|
|
ldy #38
|
|
|
|
jsr hline
|
2018-07-18 21:13:33 +00:00
|
|
|
|
|
|
|
loop_forever:
|
|
|
|
jmp loop_forever
|
|
|
|
|
2018-07-18 13:27:26 +00:00
|
|
|
|
2018-07-19 00:01:06 +00:00
|
|
|
;==================================
|
|
|
|
; HLINE
|
|
|
|
;==================================
|
|
|
|
|
|
|
|
; Color in A
|
|
|
|
; X has which line
|
|
|
|
hline:
|
2018-07-19 00:09:23 +00:00
|
|
|
pha ; 3
|
2018-07-19 00:01:06 +00:00
|
|
|
ldx gr_offsets,y ; 4+
|
|
|
|
stx hline_loop+1 ; 4
|
2018-07-19 00:09:23 +00:00
|
|
|
lda gr_offsets+1,y ; 4+
|
|
|
|
clc ; 2
|
|
|
|
adc DRAW_PAGE ; 3
|
|
|
|
sta hline_loop+2 ; 4
|
|
|
|
pla ; 4
|
2018-07-19 00:01:06 +00:00
|
|
|
ldx #39 ; 2
|
|
|
|
hline_loop:
|
|
|
|
sta $5d0,X ; 38 ; 5
|
|
|
|
dex ; 2
|
|
|
|
bpl hline_loop ; 2nt/3
|
|
|
|
rts ; 6
|
|
|
|
|
2018-07-19 00:09:23 +00:00
|
|
|
;==========================
|
|
|
|
; Clear gr screen
|
|
|
|
;==========================
|
|
|
|
; Color in A
|
|
|
|
clear_gr:
|
|
|
|
ldy #46
|
|
|
|
clear_page_loop:
|
|
|
|
jsr hline
|
|
|
|
dey
|
|
|
|
dey
|
|
|
|
bpl clear_page_loop
|
|
|
|
rts
|
2018-07-19 00:01:06 +00:00
|
|
|
|
|
|
|
|
2018-07-18 21:13:33 +00:00
|
|
|
; 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
|
2018-07-19 00:01:06 +00: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
|