ds: fix long running mystery of gr_clear

cycle counting was wrong in gr_clear

update appleii_intro to compensate

move some stuff around
This commit is contained in:
Vince Weaver 2019-11-15 12:31:28 -05:00
parent 10572d8b81
commit 46b20a427c
3 changed files with 34 additions and 38 deletions

View File

@ -70,29 +70,15 @@ appleII_intro:
jsr gr_clear_all ; 6+ 5454
; 26650
; -12
; -5465
; -5465
; -3 (jmp)
; -12 GR init
; -5465 clear page0
; -5465 clear page1
;==========
; 15705
; 15708
; FIXME: delay extra 33?
; have no idea why this is needed
lda DRAW_PAGE
lda DRAW_PAGE
lda DRAW_PAGE
lda DRAW_PAGE
lda DRAW_PAGE
lda DRAW_PAGE
lda DRAW_PAGE
lda DRAW_PAGE
lda DRAW_PAGE
lda DRAW_PAGE
lda DRAW_PAGE
; Try X=29 Y=104 cycles=15705R3
; Try X=29 Y=104 cycles=15705
lda TEMP
ldy #104 ; 2
loopA: ldx #29 ; 2
@ -101,7 +87,7 @@ loopB: dex ; 2
dey ; 2
bne loopA ; 2nt/3
jmp display_loop ; 3
; jmp display_loop ; 3
;.align $100
@ -128,14 +114,14 @@ display_loop:
outer_loop:
bit PAGE0 ; 4
bit PAGE1 ; 4
ldx #25 ; 130 cycles with PAGE0 ; 2
page0_loop: ; delay 126+bit
dex ; 2
bne page0_loop ; 2/3
bit PAGE1 ; 4
bit PAGE0 ; 4
ldx #23 ; 130 cycles with PAGE1 ; 2
page1_loop: ; delay 115+(7 loop)+4 (bit)+4(extra)
dex ; 2
@ -448,12 +434,19 @@ do_nothing_end:
forever_string:
.byte ' ','F','O','R','E','V','E','R'
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
.if 0
colors_first: .byte $00,$00,$00,$00
colors_second: .byte $00,$40,$04,$00
colors_third: .byte $04,$C4,$4C,$40
colors_fourth: .byte $4C,$FC,$CF,$C4
.endif
.assert >do_nothing = >do_nothing_end, error, "do_nothing crosses page"

View File

@ -155,13 +155,27 @@ wait_until_keypressed:
.include "graphics/starbase/starbase.inc"
.include "graphics/starbase/ship_flames.inc"
.include "graphics/starbase/star_wipe.inc"
; Apple II intro
.include "appleII_intro.s"
; missing
.include "missing.s"
; missing
.include "open_book.s"
; Starbase
.include "starbase.s"
; UP UNTIL THIS POINT CAN BE WIPED BY SOUND AT END
; FIXME: put at end after music?
;.include "earth.inc"
.include "book_40_48d.inc"
.include "credits_bg.inc"
; Apple II intro
.include "appleII_intro.s"
; things that are exactly 1 page in size
.align $100
@ -181,15 +195,6 @@ wait_until_keypressed:
.include "gr_fast_clear.s"
.include "gr_run_sequence.s" ; not critical
; missing
.include "missing.s"
; missing
.include "open_book.s"
; Starbase
.include "starbase.s"
; escape
.include "escape.s"
@ -212,8 +217,6 @@ wait_until_keypressed:
.include "create_update_type2.s"
PT3_LOC = song
; must be page aligned

View File

@ -25,7 +25,7 @@ gr_clear_all:
;===========
; 45
ldy #120 ; 2
ldy #119 ; 2
clear_all_color:
lda #$00 ; 2
;============