From 176af12a615f6b456e8f6d72fd7164999dfbd171 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Fri, 8 Nov 2019 20:58:53 -0500 Subject: [PATCH] ds: so close on credits --- demosplash/credits.s | 22 ++++++++----- demosplash/pt3_lib_mockingboard.s | 55 +++++++++++++++++++------------ 2 files changed, 47 insertions(+), 30 deletions(-) diff --git a/demosplash/credits.s b/demosplash/credits.s index 988c34ff..01d11718 100644 --- a/demosplash/credits.s +++ b/demosplash/credits.s @@ -626,23 +626,27 @@ credits_text_end: fake_music_play: - ; 1239 - 6 = 1233 + ; 1239 - 6 (ret) = 1233 - ; Try X=60 Y=4 cycles=1225R8 -; jsr clear_ay_both + + jsr clear_ay_both ; 6+1048 + + ; 1233-1054=179 + + ; Try X=2 Y=11 cycles=177R2 nop - nop - nop - nop - - ldy #4 ; 2 -uloop1: ldx #60 ; 2 + ldy #11 ; 2 +uloop1: ldx #2 ; 2 uloop2: dex ; 2 bne uloop2 ; 2nt/3 dey ; 2 bne uloop1 ; 2nt/3 rts + +fake_music_play_end: + +.assert >fake_music_play = >fake_music_play_end, error, "fake_musis_play crosses page" diff --git a/demosplash/pt3_lib_mockingboard.s b/demosplash/pt3_lib_mockingboard.s index f40979d8..fe37c3dd 100644 --- a/demosplash/pt3_lib_mockingboard.s +++ b/demosplash/pt3_lib_mockingboard.s @@ -85,41 +85,54 @@ reset_ay_both: write_ay_both: ; address - stx MOCK_6522_ORA1 ; put address on PA1 ; 3 - stx MOCK_6522_ORA2 ; put address on PA2 ; 3 + stx MOCK_6522_ORA1 ; put address on PA1 ; 4 + stx MOCK_6522_ORA2 ; put address on PA2 ; 4 lda #MOCK_AY_LATCH_ADDR ; latch_address on PB1 ; 2 - sta MOCK_6522_ORB1 ; latch_address on PB1 ; 3 - sta MOCK_6522_ORB2 ; latch_address on PB2 ; 3 + sta MOCK_6522_ORB1 ; latch_address on PB1 ; 4 + sta MOCK_6522_ORB2 ; latch_address on PB2 ; 4 ldy #MOCK_AY_INACTIVE ; go inactive ; 2 - sty MOCK_6522_ORB1 ; 3 - sty MOCK_6522_ORB2 ; 3 - + sty MOCK_6522_ORB1 ; 4 + sty MOCK_6522_ORB2 ; 4 + ;=========== + ; 28 ; value lda MB_VALUE ; 3 - sta MOCK_6522_ORA1 ; put value on PA1 ; 3 - sta MOCK_6522_ORA2 ; put value on PA2 ; 3 + sta MOCK_6522_ORA1 ; put value on PA1 ; 4 + sta MOCK_6522_ORA2 ; put value on PA2 ; 4 lda #MOCK_AY_WRITE ; ; 2 - sta MOCK_6522_ORB1 ; write on PB1 ; 3 - sta MOCK_6522_ORB2 ; write on PB2 ; 3 - sty MOCK_6522_ORB1 ; 3 - sty MOCK_6522_ORB2 ; 3 + sta MOCK_6522_ORB1 ; write on PB1 ; 4 + sta MOCK_6522_ORB2 ; write on PB2 ; 4 + sty MOCK_6522_ORB1 ; 4 + sty MOCK_6522_ORB2 ; 4 + ;=========== + ; 29 rts ; 6 ;=========== - ; 51 + ; 63 +write_ay_both_end: + +.assert >write_ay_both = >write_ay_both_end, error, "write_ay_both crosses page" + ;======================================= ; clear ay -- clear all 14 AY registers ; should silence the card ;======================================= + ; 7+(74*14)+5=1048 clear_ay_both: - ldx #14 - lda #0 - sta MB_VALUE + ldx #14 ; 2 + lda #0 ; 2 + sta MB_VALUE ; 3 clear_ay_left_loop: - jsr write_ay_both - dex - bpl clear_ay_left_loop - rts + jsr write_ay_both ; 6+63 + dex ; 2 + bpl clear_ay_left_loop ; 3 + ; -1 + rts ; 6 + +clear_ay_end: + +.assert >clear_ay_both = >clear_ay_end, error, "clea_ay_both crosses page" ;======================================= ; Detect a Mockingboard card