mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-10-25 14:26:11 +00:00
mode7_demo: initial fading code
This commit is contained in:
parent
7d61a84afc
commit
ca61c86a63
@ -7,7 +7,7 @@
|
|||||||
jsr clear_screens ; clear top/bottom of page 0/1
|
jsr clear_screens ; clear top/bottom of page 0/1
|
||||||
jsr set_gr_page0
|
jsr set_gr_page0
|
||||||
|
|
||||||
lda #$0
|
lda #$4
|
||||||
sta DRAW_PAGE
|
sta DRAW_PAGE
|
||||||
|
|
||||||
lda #<demo_rle
|
lda #<demo_rle
|
||||||
@ -23,15 +23,53 @@
|
|||||||
|
|
||||||
jsr load_rle_gr
|
jsr load_rle_gr
|
||||||
|
|
||||||
|
loop_forever:
|
||||||
|
|
||||||
lda #<fade_lookup
|
lda #<fade_lookup
|
||||||
sta GBASL
|
sta GBASL
|
||||||
lda #>fade_lookup
|
lda #>fade_lookup
|
||||||
sta GBASH
|
sta GBASH
|
||||||
|
|
||||||
loop_forever:
|
jsr gr_fade
|
||||||
|
jsr page_flip
|
||||||
|
|
||||||
|
lda #200
|
||||||
|
jsr WAIT
|
||||||
|
|
||||||
|
lda #<(fade_lookup+16)
|
||||||
|
sta GBASL
|
||||||
|
lda #>(fade_lookup+16)
|
||||||
|
sta GBASH
|
||||||
|
|
||||||
jsr gr_fade
|
jsr gr_fade
|
||||||
|
jsr page_flip
|
||||||
|
|
||||||
|
lda #200
|
||||||
|
jsr WAIT
|
||||||
|
|
||||||
|
lda #<(fade_lookup+32)
|
||||||
|
sta GBASL
|
||||||
|
lda #>(fade_lookup+32)
|
||||||
|
sta GBASH
|
||||||
|
|
||||||
|
jsr gr_fade
|
||||||
|
jsr page_flip
|
||||||
|
|
||||||
|
lda #200
|
||||||
|
jsr WAIT
|
||||||
|
|
||||||
|
lda #<(fade_lookup+48)
|
||||||
|
sta GBASL
|
||||||
|
lda #>(fade_lookup+48)
|
||||||
|
sta GBASH
|
||||||
|
|
||||||
|
jsr gr_fade
|
||||||
|
jsr page_flip
|
||||||
|
|
||||||
|
lda #200
|
||||||
|
jsr WAIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
jmp loop_forever
|
jmp loop_forever
|
||||||
|
|
||||||
@ -47,17 +85,17 @@ gr_fade:
|
|||||||
gr_copy_loop:
|
gr_copy_loop:
|
||||||
lda gr_offsets,X ; lookup low byte for line addr ; 4+
|
lda gr_offsets,X ; lookup low byte for line addr ; 4+
|
||||||
|
|
||||||
sta gr_copy_line+1 ; out and in are the same ; 4
|
sta gr_copy_line1+1 ; out and in are the same ; 4
|
||||||
sta gr_copy_line+4 ; 4
|
sta gr_copy_line2+1 ; 4
|
||||||
|
|
||||||
lda gr_offsets+1,X ; lookup high byte for line addr ; 4+
|
lda gr_offsets+1,X ; lookup high byte for line addr ; 4+
|
||||||
clc ; 2
|
clc ; 2
|
||||||
adc DRAW_PAGE ; 3
|
adc DRAW_PAGE ; 3
|
||||||
sta gr_copy_line+5 ; 4
|
sta gr_copy_line2+2 ; 4
|
||||||
|
|
||||||
lda gr_offsets+1,X ; lookup high byte for line addr ; 4+
|
lda gr_offsets+1,X ; lookup high byte for line addr ; 4+
|
||||||
adc #$8 ; for now, fixed 0xc ; 2
|
adc #$8 ; for now, fixed 0xc ; 2
|
||||||
sta gr_copy_line+2 ; 4
|
sta gr_copy_line1+2 ; 4
|
||||||
|
|
||||||
ldy #0 ; set xpos counter to 0 ; 2
|
ldy #0 ; set xpos counter to 0 ; 2
|
||||||
|
|
||||||
@ -67,16 +105,44 @@ gr_copy_loop:
|
|||||||
|
|
||||||
gr_copy_below4:
|
gr_copy_below4:
|
||||||
ldy #119 ; for early ones, copy 120 bytes ; 2
|
ldy #119 ; for early ones, copy 120 bytes ; 2
|
||||||
bcc gr_copy_line ; ; 3
|
bcc gr_copy_line1 ; ; 3
|
||||||
|
|
||||||
gr_copy_above4: ; for last four, just copy 80 bytes
|
gr_copy_above4: ; for last four, just copy 80 bytes
|
||||||
ldy #79 ; 2
|
ldy #79 ; 2
|
||||||
|
|
||||||
gr_copy_line:
|
gr_copy_line1:
|
||||||
lda $ffff,Y ; load a byte (self modified) ; 4+
|
lda $ffff,Y ; load a byte (self modified) ; 4+
|
||||||
|
pha
|
||||||
|
|
||||||
|
sty TEMPY ; save Y
|
||||||
|
|
||||||
|
; do high nibble
|
||||||
|
and #$f0
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
|
||||||
|
tay
|
||||||
|
lda (GBASL),Y
|
||||||
|
and #$f0
|
||||||
|
sta TEMP
|
||||||
|
|
||||||
|
; do low nibble
|
||||||
|
pla
|
||||||
|
and #$0f
|
||||||
|
|
||||||
|
tay
|
||||||
|
lda (GBASL),Y
|
||||||
|
and #$0f
|
||||||
|
ora TEMP
|
||||||
|
|
||||||
|
ldy TEMPY ; restore Y
|
||||||
|
|
||||||
|
gr_copy_line2:
|
||||||
sta $ffff,Y ; store a byte (self modified) ; 5
|
sta $ffff,Y ; store a byte (self modified) ; 5
|
||||||
dey ; decrement pointer ; 2
|
dey ; decrement pointer ; 2
|
||||||
bpl gr_copy_line ; ; 2nt/3
|
bpl gr_copy_line1 ; ; 2nt/3
|
||||||
|
|
||||||
gr_copy_line_done:
|
gr_copy_line_done:
|
||||||
inx ; increment ypos value ; 2
|
inx ; increment ypos value ; 2
|
||||||
@ -93,13 +159,14 @@ gr_copy_line_done:
|
|||||||
.include "../asm_routines/gr_unrle.s"
|
.include "../asm_routines/gr_unrle.s"
|
||||||
.include "../asm_routines/hlin_clearscreen.s"
|
.include "../asm_routines/hlin_clearscreen.s"
|
||||||
.include "../asm_routines/gr_setpage.s"
|
.include "../asm_routines/gr_setpage.s"
|
||||||
|
.include "../asm_routines/pageflip.s"
|
||||||
|
|
||||||
.include "mode7_demo_backgrounds.inc"
|
.include "mode7_demo_backgrounds.inc"
|
||||||
|
|
||||||
|
|
||||||
; Fade paramaters
|
; Fade paramaters
|
||||||
fade_lookup:
|
fade_lookup:
|
||||||
.byte $0,$1,$2,$3,$4,$5,$6,$7, $8,$9,$a,$b,$c,$d,$e,$f
|
.byte $00,$11,$22,$33,$44,$55,$66,$77, $88,$99,$aa,$bb,$cc,$dd,$ee,$ff
|
||||||
.byte $0,$0,$0,$2,$0,$0,$2,$5, $5,$8,$5,$3,$4,$8,$4,$7
|
.byte $00,$00,$00,$22,$00,$00,$22,$55, $55,$88,$55,$33,$44,$88,$44,$77
|
||||||
.byte $0,$0,$0,$0,$0,$0,$5,$0, $0,$0,$0,$0,$8,$0,$0,$5
|
.byte $00,$00,$00,$00,$00,$00,$55,$00, $00,$00,$00,$00,$88,$00,$00,$55
|
||||||
.byte $0,$0,$0,$0,$0,$0,$0,$0, $0,$0,$0,$0,$0,$0,$0,$0
|
.byte $00,$00,$00,$00,$00,$00,$00,$00, $00,$00,$00,$00,$00,$00,$00,$00
|
||||||
|
Loading…
Reference in New Issue
Block a user