waterfall: more code condensing

This commit is contained in:
Vince Weaver 2018-10-04 23:07:52 -04:00
parent 226b19808c
commit 24f1cd4c57

View File

@ -1063,375 +1063,169 @@ ground_loop_three_done:
; we come in already 21 cycles into things
; so the first scanline is a loss (but that's OK)
; first scanline: 21+ 2 (from ldy) so need to kill 65-23 = 42
; second scanline, again kill so 65 killed
display_four:
; first scanline comes in with 38
four_first_four_lines:
; line 0-3 = 65*4 = 260
; -38
; -2
; -2
; -25
;=========================
; 193
lda #193 ; 2
jsr delay_a ; 25+193
; line 0
; 38
ldy #4 ; 2
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
nop ; 2
nop ; 2
; line 1, 65 cycles
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
nop ; 2
; line 2, 65 cycles
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
nop ; 2
; line 3, 65 cycles
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
nop ; 2
four_twinkle_stars:
twinkle_loop_four:
; line 0
;=== line 0
bit PAGE1 ; 4
; delay 29
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
nop ; 2
nop
; falls
bit PAGE1 ; 4
lda YPOS ; 3
bit PAGE1 ; 4
; endfalls
; delay 21
nop
nop
; asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
lda #34 ; 2
jsr delay_a ; 25+34
; line 2
;=== line 1
bit PAGE1 ; 4
; delay 29
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
nop ; 2
nop
; falls
bit PAGE1 ; 4
lda YPOS ; 3
bit PAGE1 ; 4
; end falls
; delay 21
nop
nop
; asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
lda #34 ; 2
jsr delay_a ; 25+34
; line 3
;=== line 2
bit PAGE1 ; 4
; delay 29
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
nop ; 2
nop
; falls
bit PAGE1 ; 4
lda YPOS ; 3
bit PAGE1 ; 4
; end falls
; delay 21
; asl DUMMY ; 6
nop
nop
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
lda #34 ; 2
jsr delay_a ; 25+34
; line 4
;=== line 3
bit PAGE1 ; 4
; delay 29
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
nop ; 2
nop
; falls
bit PAGE1 ; 4
lda YPOS ; 3
bit PAGE1 ; 4 ; 44
; end falls
; delay 21 - 7 from loop
; asl DUMMY ; 6
nop
nop
asl DUMMY ; 6
nop ; 2 ; 58
lda #27 ; 2
jsr delay_a ; 25+27
dey ; 2
beq twinkle_loop_four_done ;
; 2
beq twinkle_loop_four_done ; 3
; -1
jmp twinkle_loop_four ; 3
twinkle_loop_four_done:
ldy #31 ; 2
falls_loop_four:
; line 0
;=== line 0
bit PAGE0 ; 4
; delay 31
lda #4 ; 2
jsr delay_a ; 25+4
; delay 11
bit PAGE0 ; 4
; delay 29
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
bit PAGE0 ; 4
; delay 19
nop ; 2
nop ; 2
nop
; falls
bit PAGE0 ; 4
lda YPOS ; 3
bit PAGE0 ; 4
; endfalls
; delay 21
; asl DUMMY ; 6
nop
nop
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
; line 2
;=== line 1
bit PAGE0 ; 4
; delay 29
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
nop ; 2
nop
; falls
; delay 31
lda #4 ; 2
jsr delay_a ; 25+4
; delay 11
bit PAGE1 ; 4
lda YPOS ; 3
bit PAGE0 ; 4
; end falls
; delay 21
nop
nop
; asl DUMMY ; 6
; delay 19
nop ; 2
nop ; 2
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
; line 3
;=== line 2
bit PAGE0 ; 4
; delay 29
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
nop ; 2
nop
; falls
; delay 31
lda #4 ; 2
jsr delay_a ; 25+4
; delay 11
bit PAGE1 ; 4
lda YPOS ; 3
bit PAGE0 ; 4
; end falls
; delay 21
; asl DUMMY ; 6
nop
nop
; delay 19
nop ; 2
nop ; 2
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
; line 4
;=== line 3
bit PAGE0 ; 4
; delay 29
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
nop ; 2
nop
; falls
; delay 31
lda #4 ; 2
jsr delay_a ; 25+4
; delay 11
bit PAGE0 ; 4
lda YPOS ; 3
bit PAGE0 ; 4 ; 44
; end falls
; delay 21 - 7 from loop
; asl DUMMY ; 6
nop
nop
nop ; 2
nop ; 2
asl DUMMY ; 6
nop ; 2 ; 58
dey ; 2
beq falls_loop_four_done ;
; 2
beq falls_loop_four_done ; 3
; -1
jmp falls_loop_four ; 3
falls_loop_four_done:
; 3
ldy #12 ; 2
ground_loop_four:
; line 0
;=== line 0
bit PAGE0 ; 4
; delay 29
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
nop ; 2
nop
; falls
bit PAGE0 ; 4
lda YPOS ; 3
bit PAGE0 ; 4
; endfalls
; delay 21
; asl DUMMY ; 6
nop
nop
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
; delay 61
lda #34 ; 2
jsr delay_a ; 25+34
; line 2
;=== line 1
bit PAGE1 ; 4
; delay 29
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
nop ; 2
nop
; falls
bit PAGE1 ; 4
lda YPOS ; 3
bit PAGE1 ; 4
; end falls
; delay 21
; asl DUMMY ; 6
nop
nop
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
; delay 61
lda #34 ; 2
jsr delay_a ; 25+34
; line 3
;=== line 2
bit PAGE0 ; 4
; delay 29
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
nop ; 2
nop
; falls
bit PAGE0 ; 4
lda YPOS ; 3
bit PAGE0 ; 4
; end falls
; delay 21
nop
nop
; asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
; delay 61
lda #34 ; 2
jsr delay_a ; 25+34
; line 4
;=== line 3
bit PAGE1 ; 4
; delay 29
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
asl DUMMY ; 6
lda YPOS ; 3
nop ; 2
nop
; falls
bit PAGE1 ; 4
lda YPOS ; 3
bit PAGE1 ; 4 ; 44
; end falls
; delay 21 - 7 from loop
nop
nop
; asl DUMMY ; 6
asl DUMMY ; 6
nop ; 2 ; 58
; delay 54
lda #27 ; 2
jsr delay_a ; 25+27
dey ; 2
beq ground_loop_four_done ;
; 2
beq ground_loop_four_done ; 3
; -1
jmp ground_loop_four ; 3
ground_loop_four_done:
; 3
nop ; 2
jmp display_loop_return ; 3