xmas24: add missing files

This commit is contained in:
Vince Weaver 2024-12-21 12:56:01 -05:00
parent c0d33374fb
commit 2458078125
3 changed files with 100 additions and 0 deletions

View File

@ -0,0 +1,18 @@
hgr_page_flip:
lda DRAW_PAGE
beq flip_to_page1
flip_to_page2:
bit PAGE2
lda #0
beq done_hgr_page_flip ; bra
flip_to_page1:
bit PAGE1
lda #$20
done_hgr_page_flip:
sta DRAW_PAGE
rts

View File

@ -0,0 +1,34 @@
left_lookup_main:
.byte $00,$00,$00,$00,$01,$01,$01,$01,$02,$02,$02,$02,$03,$03,$03,$03
.byte $04,$04,$04,$04,$05,$05,$05,$05,$06,$06,$06,$06,$07,$07,$07,$07
.byte $08,$08,$08,$08,$09,$09,$09,$09,$0A,$0A,$0A,$0A,$0B,$0B,$0B,$0B
.byte $0C,$0C,$0C,$0C,$0D,$0D,$0D,$0D,$0E,$0E,$0E,$0E,$0F,$0F,$0F,$0F
.byte $10,$10,$10,$10,$11,$11,$11,$11,$12,$12,$12,$12,$13,$13,$13,$13
.byte $14,$14,$14,$14,$15,$15,$15,$15,$16,$16,$16,$16,$17,$17,$17,$17
.byte $18,$18,$18,$18,$19,$19,$19,$19,$1A,$1A,$1A,$1A,$1B,$1B,$1B,$1B
.byte $1C,$1C,$1C,$1C,$1D,$1D,$1D,$1D,$1E,$1E,$1E,$1E,$1F,$1F,$1F,$1F
.byte $80,$80,$80,$80,$81,$81,$81,$81,$82,$82,$82,$82,$83,$83,$83,$83
.byte $84,$84,$84,$84,$85,$85,$85,$85,$86,$86,$86,$86,$87,$87,$87,$87
.byte $88,$88,$88,$88,$89,$89,$89,$89,$8A,$8A,$8A,$8A,$8B,$8B,$8B,$8B
.byte $8C,$8C,$8C,$8C,$8D,$8D,$8D,$8D,$8E,$8E,$8E,$8E,$8F,$8F,$8F,$8F
.byte $90,$90,$90,$90,$91,$91,$91,$91,$92,$92,$92,$92,$93,$93,$93,$93
.byte $94,$94,$94,$94,$95,$95,$95,$95,$96,$96,$96,$96,$97,$97,$97,$97
.byte $98,$98,$98,$98,$99,$99,$99,$99,$9A,$9A,$9A,$9A,$9B,$9B,$9B,$9B
.byte $9C,$9C,$9C,$9C,$9D,$9D,$9D,$9D,$9E,$9E,$9E,$9E,$9F,$9F,$9F,$9F
left_lookup_next:
.byte $00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60
.byte $00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60
.byte $00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60
.byte $00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60
.byte $00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60
.byte $00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60
.byte $00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60
.byte $00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60
.byte $00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60
.byte $00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60
.byte $00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60
.byte $00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60
.byte $00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60
.byte $00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60
.byte $00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60
.byte $00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60,$00,$20,$40,$60

48
demos/xmas_2024/vblank.s Normal file
View File

@ -0,0 +1,48 @@
; wait for VBLANK
; no way to do this on II/II+ short of vapor lock / floating bus
; IIe you can read $C019 (in VBLANK when top bit 0)
; IIc you can also read $C019 (also can setup interrupt)
; IIgs you can read $C019 but reverse of IIe (in VBLANK when top bit 1)
VBLANK = $C019 ;
; wait for vblank on IIe
; positive? during vblank
; TODO: patch this to a RTS on non-IIe systems
wait_vblank:
; Assume Apple IIe
; lda APPLEII_MODEL
; cmp #'e'
; bne no_vblank
; 4cade does this, the opposite of the way were doing it originally
; $C019 on IIe high bit is VBL' or "negative if not in VBLANK"
; see page 66 in Sather's IIe
wait_vblank_iie:
lda VBLANK
bpl wait_vblank_iie ; repeat until negative
; not in vblank
wait_vblank_done_iie:
lda VBLANK
bmi wait_vblank_done_iie ; repeat until positive (start vblank)
; in vblank
no_vblank:
.if 0
wait_vblank_iie:
lda VBLANK
bmi wait_vblank_iie ; wait for positive (in vblank)
wait_vblank_done_iie:
lda VBLANK ; wait for negative (vlank done)
bpl wait_vblank_done_iie
no_vblank:
.endif
rts