interlace: 4 bars

This commit is contained in:
Vince Weaver 2019-06-11 17:07:50 -04:00
parent 20f591b051
commit e1c2c2356b
3 changed files with 141 additions and 14 deletions

View File

@ -184,18 +184,20 @@ display_loop:
;======================================================
; 4550 -- VBLANK
; -162 -- erase 22+8+6+126 = 162
; -174 -- raster 16+26+6+126 = 174
; -582 -- erase 22+4*(8+6+126) = 582
; -696 -- move+draw 4*(16+26+6+126) = 696
; -10 -- keypress
;=======
; 4204
; 3262
pad_time:
; we erase, then draw
; doing a blanket erase of all 128 lines would cost 3459 cycles!
; erase red
;=========================
; ERASE
;=========================
lda #$00 ; 2
sta smc_raster_color1_1+1 ; 4
@ -206,13 +208,45 @@ pad_time:
;=============
; 22
; erase red
lda red_x ; 4
and #$7f ; 2
tax ; 2
jsr draw_rasterbar ; 6+126
; erase yellow
lda yellow_x ; 4
and #$7f ; 2
tax ; 2
jsr draw_rasterbar ; 6+126
; erase green
lda green_x ; 4
and #$7f ; 2
tax ; 2
jsr draw_rasterbar ; 6+126
; erase red
lda blue_x ; 4
and #$7f ; 2
tax ; 2
jsr draw_rasterbar ; 6+126
;=========================
; MOVE and DRAW
;=========================
;============
; move red
ldy red_x ; 4
@ -239,13 +273,102 @@ pad_time:
jsr draw_rasterbar ; 6+126
; Try X=43 Y=19 cycles=4200 R4
;============
; move yellow
ldy yellow_x ; 4
lda movement_table,Y ; 4
sta yellow_x ; 4
and #$7f ; 2
tax ; 2
;==========
; 16
; draw yellow
lda #$33 ; 2
sta smc_raster_color1_1+1 ; 4
sta smc_raster_color1_2+1 ; 4
lda #$bb ; 2
sta smc_raster_color2_1+1 ; 4
sta smc_raster_color2_2+1 ; 4
lda #$ff ; 2
sta smc_raster_color3_1+1 ; 4
;=============
; 26
jsr draw_rasterbar ; 6+126
;============
; move green
ldy green_x ; 4
lda movement_table,Y ; 4
sta green_x ; 4
and #$7f ; 2
tax ; 2
;==========
; 16
; draw green
lda #$33 ; 2
sta smc_raster_color1_1+1 ; 4
sta smc_raster_color1_2+1 ; 4
lda #$bb ; 2
sta smc_raster_color2_1+1 ; 4
sta smc_raster_color2_2+1 ; 4
lda #$ff ; 2
sta smc_raster_color3_1+1 ; 4
;=============
; 26
jsr draw_rasterbar ; 6+126
;============
; move blue
ldy blue_x ; 4
lda movement_table,Y ; 4
sta blue_x ; 4
and #$7f ; 2
tax ; 2
;==========
; 16
; draw blue
lda #$33 ; 2
sta smc_raster_color1_1+1 ; 4
sta smc_raster_color1_2+1 ; 4
lda #$bb ; 2
sta smc_raster_color2_1+1 ; 4
sta smc_raster_color2_2+1 ; 4
lda #$ff ; 2
sta smc_raster_color3_1+1 ; 4
;=============
; 26
jsr draw_rasterbar ; 6+126
;============================
; WAIT for VBLANK to finish
;============================
; Try X=5 Y=105 cycles=3256 R6
nop
nop
nop
ldy #19 ; 2
loop1: ldx #43 ; 2
ldy #105 ; 2
loop1: ldx #5 ; 2
loop2: dex ; 2
bne loop2 ; 2nt/3
dey ; 2
@ -388,4 +511,7 @@ pictures:
.include "rb_bg.inc"
red_x: .byte $10
red_x: .byte $10
yellow_x: .byte $20
green_x: .byte $30
blue_x: .byte $40

View File

@ -21,7 +21,8 @@ rb_bg_low: .byte $28 ; ysize=48
.byte $20, $A3,$22, $FF, $F1, $F4, $F2, $FF
.byte $62, $00,$00, $01, $A3,$04, $02, $A3,$04, $02
.byte $A0,$12,$00, $A5,$FF, $77, $A4,$F7, $02, $09, $A0,$FF,$00
.byte $A0,$C3,$00, $A0,$14,$80, $A0,$12,$00, $A0,$18,$80, $AE,$00, $A0,$1C,$80, $A6,$00
.byte $A0,$C3,$00, $A0,$14,$08, $A0,$12,$00, $A0,$18,$08, $AD,$00, $80, $A0,$1C,$88
.byte $80, $A5,$00
.byte $A1
rb_bg_high: .byte $28 ; ysize=48
.byte $FF, $5F, $F0, $00, $F0, $5F, $F0
@ -31,13 +32,13 @@ rb_bg_high: .byte $28 ; ysize=48
.byte $F0, $00, $FF, $5F, $F0, $00, $F0
.byte $5F,$5F, $00, $FF, $F0, $0F, $00, $FF
.byte $F0, $FF, $00, $5F, $F0,$F0, $00,$00, $FF
.byte $00,$00, $FF, $5F, $00,$00, $FF, $F0, $5F
.byte $00, $FF, $5F, $F5, $00, $FF, $F0
.byte $00,$00, $FF, $5F, $00,$00, $FF, $F0, $0F
.byte $00, $FF, $5F, $F0, $00, $FF, $F0
.byte $FF, $00, $FF, $F0, $0F, $00, $5F
.byte $F0,$F0, $00, $FF, $05, $FF, $00, $FF
.byte $05, $FF, $00, $F0, $F5, $5F, $00,$00
.byte $FF, $00,$00, $FF, $F0,$F0, $00, $FF, $05
.byte $FF, $00, $FF, $F0, $0F, $00, $FF
.byte $FF, $00, $FF, $F0, $5F, $00, $FF
.byte $05, $FF, $00, $FF, $05, $FF, $00
.byte $F0, $F5, $5F, $00, $05, $00, $05
.byte $00, $05, $00, $05, $00, $05,$05, $A3,$00
@ -55,6 +56,6 @@ rb_bg_high: .byte $28 ; ysize=48
.byte $02, $0D, $AD,$00, $AE,$66, $A0,$1A,$00, $AE,$66, $A0,$1A,$00
.byte $AE,$66, $A0,$1A,$00, $AE,$66, $A0,$1A,$00, $AE,$66, $A0,$1A,$00, $AE,$66
.byte $A0,$1A,$00, $AE,$66, $A0,$1A,$00, $AE,$66, $A0,$1A,$00, $AE,$66, $A0,$1A,$00
.byte $AE,$66, $A0,$19,$00, $A0,$10,$80, $A0,$16,$00, $80, $A0,$12,$88, $80
.byte $A0,$12,$00, $A0,$18,$80, $AE,$00, $A0,$1C,$80, $A6,$00
.byte $AE,$66, $A0,$18,$00, $80, $A0,$10,$88, $80, $A0,$15,$00, $A0,$14,$08
.byte $A0,$12,$00, $A0,$18,$08, $AD,$00, $80, $A0,$1C,$88, $80, $A5,$00
.byte $A1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB