diff --git a/demosplash/pt3_lib.s b/demosplash/pt3_lib.s index 054bdadf..416f9bad 100644 --- a/demosplash/pt3_lib.s +++ b/demosplash/pt3_lib.s @@ -21,7 +21,7 @@ ; + 2817 bytes -- eliminate pt3_version. Slighly faster but also bigger ; + 2828 bytes -- fix some correctness issues ; + 2776 bytes -- init vars with loop (slower, but more correct and smaller) - +; + 2783 bytes -- fix vibrato code to work again ; TODO ; move some of these flags to be bits rather than bytes? @@ -1064,23 +1064,24 @@ done_note: lsr pt3_mixer_value handle_onoff: - lda note_a+NOTE_ONOFF,X ;if (a->onoff>0) { + ldy note_a+NOTE_ONOFF,X ;if (a->onoff>0) { beq done_onoff - dec note_a+NOTE_ONOFF,X ; a->onoff--; + dey ; a->onoff--; - bne done_onoff ; if (a->onoff==0) { + bne put_offon ; if (a->onoff==0) { lda note_a+NOTE_ENABLED,X eor #$1 ; toggle sta note_a+NOTE_ENABLED,X - .byte $a9 ;mask do_onoff + beq do_offon do_onoff: - dex ; select ONOFF - ;lda note_a+NOTE_ONOFF_DELAY,X ; if (a->enabled) a->onoff=a->onoff_delay; + ldy note_a+NOTE_ONOFF_DELAY,X ; if (a->enabled) a->onoff=a->onoff_delay; + jmp put_offon do_offon: - lda note_a+NOTE_OFFON_DELAY,X ; else a->onoff=a->offon_delay; + ldy note_a+NOTE_OFFON_DELAY,X ; else a->onoff=a->offon_delay; put_offon: + tya sta note_a+NOTE_ONOFF,X done_onoff: diff --git a/ootw/pt3_lib.s b/ootw/pt3_lib.s index 054bdadf..416f9bad 100644 --- a/ootw/pt3_lib.s +++ b/ootw/pt3_lib.s @@ -21,7 +21,7 @@ ; + 2817 bytes -- eliminate pt3_version. Slighly faster but also bigger ; + 2828 bytes -- fix some correctness issues ; + 2776 bytes -- init vars with loop (slower, but more correct and smaller) - +; + 2783 bytes -- fix vibrato code to work again ; TODO ; move some of these flags to be bits rather than bytes? @@ -1064,23 +1064,24 @@ done_note: lsr pt3_mixer_value handle_onoff: - lda note_a+NOTE_ONOFF,X ;if (a->onoff>0) { + ldy note_a+NOTE_ONOFF,X ;if (a->onoff>0) { beq done_onoff - dec note_a+NOTE_ONOFF,X ; a->onoff--; + dey ; a->onoff--; - bne done_onoff ; if (a->onoff==0) { + bne put_offon ; if (a->onoff==0) { lda note_a+NOTE_ENABLED,X eor #$1 ; toggle sta note_a+NOTE_ENABLED,X - .byte $a9 ;mask do_onoff + beq do_offon do_onoff: - dex ; select ONOFF - ;lda note_a+NOTE_ONOFF_DELAY,X ; if (a->enabled) a->onoff=a->onoff_delay; + ldy note_a+NOTE_ONOFF_DELAY,X ; if (a->enabled) a->onoff=a->onoff_delay; + jmp put_offon do_offon: - lda note_a+NOTE_OFFON_DELAY,X ; else a->onoff=a->offon_delay; + ldy note_a+NOTE_OFFON_DELAY,X ; else a->onoff=a->offon_delay; put_offon: + tya sta note_a+NOTE_ONOFF,X done_onoff: diff --git a/pt3_lib/pt3_lib.s b/pt3_lib/pt3_lib.s index 054bdadf..416f9bad 100644 --- a/pt3_lib/pt3_lib.s +++ b/pt3_lib/pt3_lib.s @@ -21,7 +21,7 @@ ; + 2817 bytes -- eliminate pt3_version. Slighly faster but also bigger ; + 2828 bytes -- fix some correctness issues ; + 2776 bytes -- init vars with loop (slower, but more correct and smaller) - +; + 2783 bytes -- fix vibrato code to work again ; TODO ; move some of these flags to be bits rather than bytes? @@ -1064,23 +1064,24 @@ done_note: lsr pt3_mixer_value handle_onoff: - lda note_a+NOTE_ONOFF,X ;if (a->onoff>0) { + ldy note_a+NOTE_ONOFF,X ;if (a->onoff>0) { beq done_onoff - dec note_a+NOTE_ONOFF,X ; a->onoff--; + dey ; a->onoff--; - bne done_onoff ; if (a->onoff==0) { + bne put_offon ; if (a->onoff==0) { lda note_a+NOTE_ENABLED,X eor #$1 ; toggle sta note_a+NOTE_ENABLED,X - .byte $a9 ;mask do_onoff + beq do_offon do_onoff: - dex ; select ONOFF - ;lda note_a+NOTE_ONOFF_DELAY,X ; if (a->enabled) a->onoff=a->onoff_delay; + ldy note_a+NOTE_ONOFF_DELAY,X ; if (a->enabled) a->onoff=a->onoff_delay; + jmp put_offon do_offon: - lda note_a+NOTE_OFFON_DELAY,X ; else a->onoff=a->offon_delay; + ldy note_a+NOTE_OFFON_DELAY,X ; else a->onoff=a->offon_delay; put_offon: + tya sta note_a+NOTE_ONOFF,X done_onoff: diff --git a/pt3_player/Makefile b/pt3_player/Makefile index 70b61803..6bc4d320 100644 --- a/pt3_player/Makefile +++ b/pt3_player/Makefile @@ -61,6 +61,7 @@ pt3_debug.dsk: PT3_DUMPER PT3_TIMER PT3_TABLE_TEST HELLO_DEBUG DUMP $(DOS33) -y pt3_debug.dsk BSAVE -a 0x4000 ./music/BH.PT3 $(DOS33) -y pt3_debug.dsk BSAVE -a 0x4000 ./music/ND.PT3 $(DOS33) -y pt3_debug.dsk BSAVE -a 0x4000 ./music/OO.PT3 + $(DOS33) -y pt3_debug.dsk BSAVE -a 0x4000 ./music/DY.PT3 HELLO: hello.bas ../asoft_basic-utils/tokenize_asoft < hello.bas > HELLO diff --git a/pt3_player/OPTIMIZATION.txt b/pt3_player/OPTIMIZATION.txt index 279d50f5..711cc05a 100644 --- a/pt3_player/OPTIMIZATION.txt +++ b/pt3_player/OPTIMIZATION.txt @@ -29,6 +29,7 @@ Code Optimization Qkumba-SuperSMC 2739 ?? 1B.15 27s 171s 15.8% MoveNoteToZP 2650 ?? 1A.23 26s 171s 15.2% MinorFixes 2418 + 143 1A.1F 26s 171s 15.2% + FixVibrato 2423 + 143 Times: Validated BH.PT3: 10.0B 16 1:33 93 17.2% diff --git a/pt3_player/music/DY.PT3 b/pt3_player/music/DY.PT3 new file mode 100644 index 00000000..228cdff3 Binary files /dev/null and b/pt3_player/music/DY.PT3 differ diff --git a/pt3_player/pt3_dumper.s b/pt3_player/pt3_dumper.s index 61f1190c..9725f73a 100644 --- a/pt3_player/pt3_dumper.s +++ b/pt3_player/pt3_dumper.s @@ -425,7 +425,8 @@ song_list: ; .asciiz "CR.PT3" ; .asciiz "EA.PT3" ; .asciiz "RI.PT3" - .asciiz "OO.PT3" +; .asciiz "OO.PT3" + .asciiz "DY.PT3" ;========= ;routines diff --git a/pt3_player/pt3_lib.s b/pt3_player/pt3_lib.s index 014055c6..af64a58e 100644 --- a/pt3_player/pt3_lib.s +++ b/pt3_player/pt3_lib.s @@ -22,7 +22,8 @@ ; + 2828 bytes -- fix some correctness issues ; + 2776 bytes -- init vars with loop (slower, but more correct and smaller) ; + 2739 bytes -- qkumba's crazy SMC everywhere patch -; + 2430+120 = 2650 bytes -- move NOTE structs to page0 +; + 2418+143 = 2561 bytes -- move NOTE structs to page0 +; + 2423+143 = 2566 bytes -- fix vibrato code ; TODO ; move some of these flags to be bits rather than bytes? @@ -1034,13 +1035,13 @@ handle_onoff: bne put_offon ; if (a->onoff==0) { lda note_a+NOTE_ENABLED,X - eor #$1 ; toggle + eor #$1 ; toggle note_enabled sta note_a+NOTE_ENABLED,X - .byte $a9 ;mask do_onoff + beq do_offon do_onoff: - dex ; select ONOFF - ;lda note_a+NOTE_ONOFF_DELAY,X ; if (a->enabled) a->onoff=a->onoff_delay; + ldy note_a+NOTE_ONOFF_DELAY,X ; if (a->enabled) a->onoff=a->onoff_delay; + jmp put_offon do_offon: ldy note_a+NOTE_OFFON_DELAY,X ; else a->onoff=a->offon_delay; put_offon: