ds: some more work on anti-glitch

This commit is contained in:
Vince Weaver 2019-11-12 23:53:27 -05:00
parent 3e8158b8c2
commit 5b7901d1c9
5 changed files with 64 additions and 38 deletions

View File

@ -1,3 +1,9 @@
TODO:
+ red underline on missing
+ glitch prevention finish
+ clear screen at begin on missing
Music glitching:
+ Demosplash
gen 4 pages
@ -11,6 +17,7 @@ Music glitching:
TODO:
CYCLE: Apple II intro
+ Remove keyboard pause

View File

@ -445,8 +445,6 @@ loop2: dex ; 2
rts ; 6
do_nothing_end:
.assert >do_nothing = >do_nothing_end, error, "do_nothing crosses page"
forever_string:
.byte ' ','F','O','R','E','V','E','R'
@ -455,3 +453,7 @@ colors_first: .byte $00,$00,$00,$00
colors_second: .byte $00,$04,$40,$00
colors_third: .byte $40,$4C,$C4,$04
colors_fourth: .byte $C4,$CF,$FC,$4C
.assert >do_nothing = >do_nothing_end, error, "do_nothing crosses page"

View File

@ -2,53 +2,67 @@
; Autogenerates code that does interleaved Page0/Page1 lores mode
; but leaving room for 14 pixels/line of per-scanline color
; originally 183,589
; takes roughly 12 + 192*((49*16)+2+38) + 15 = 158,235!!!!
; want to play sound every 15787 cycles (10.0)
; so every 19.2 times through loop? is 16 close enough?
; 11 times should update???
UPDATE_START = $9800
DEFAULT_COLOR = $0
create_update_type1:
ldx #192
lda #<UPDATE_START
sta OUTL
lda #>UPDATE_START
sta OUTH
lda #<one_scanline
sta INL
lda #>one_scanline
sta INH
ldx #192 ; 2
lda #<UPDATE_START ; 2
sta OUTL ; 3
lda #>UPDATE_START ; 2
sta OUTH ; 3
;===========
; 12
create_update_outer_loop:
ldy #0
ldy #48 ; 2
create_update_inner_loop:
lda (INL),Y
sta (OUTL),Y
iny
cpy #49
bne create_update_inner_loop
lda one_scanline,Y ; 4+
sta (OUTL),Y ; 6
dey ; 2
bpl create_update_inner_loop ; 3
;============
; 16
; -1
; toggle PAGE0/PAGE1
txa
and #$1 ; ror?
clc
adc #$54
ldy #1
sta (OUTL),Y
txa ; 2
and #$1 ; ror? ; 2
clc ; 2
adc #$54 ; 2
ldy #1 ; 2
sta (OUTL),Y ; 6
clc
lda #49
adc OUTL
sta OUTL
lda OUTH
adc #0
sta OUTH
clc ; 2
lda #49 ; 2
adc OUTL ; 3
sta OUTL ; 3
lda OUTH ; 3
adc #0 ; 2
sta OUTH ; 3
dex
bne create_update_outer_loop
dex ; 2
bne create_update_outer_loop ; 3
;===========
; 38
ldy #0
lda #$60
sta (OUTL),Y
; -1
ldy #0 ; 2
lda #$60 ; 2
sta (OUTL),Y ; 6
rts
rts ; 6
;=============
; 15
BARS_START = 46

View File

@ -50,7 +50,6 @@ zp_clear_loop:
lda #1
sta LOOP
;===========================
; Enable graphics
;===========================

View File

@ -6,6 +6,10 @@
missing_intro:
; we come into this at the very end of vblank
; we should be playing a frame of music every
; 17030 - 1243 = 15787 cycles or so
;===================
; init vars
@ -15,7 +19,7 @@ missing_intro:
;=============================
; setup graphics code
jsr create_update_type1
jsr create_update_type1 ;
jsr play_frame_compressed