ds: more work on sound

slightly better, weird pause :(
This commit is contained in:
Vince Weaver 2019-11-18 15:46:12 -05:00
parent 7b263360a6
commit 3da22c126a
6 changed files with 46 additions and 23 deletions

View File

@ -12,7 +12,7 @@ demosplash2019:
;==================================================
lda #$38
ldy #$20
ldy #$0
zp_clear_loop:
sta $0,y
iny

View File

@ -41,6 +41,26 @@ filbuf = $3D6 ; filbuf: .res 4 ; = bit2tbl+86
start:
jsr init ; unhook DOS, init nibble table
clear_out_ram:
ldx #$14
stx OUTH
ldy #0
sty OUTL
lda #$77
clear_ram_outer:
ldy #0
clear_ram_inner:
dey
sta (OUTL),Y
bne clear_ram_inner
inx
stx OUTH
cpx #$c0
bne clear_ram_outer
;======================
which_load_loop:

View File

@ -30,7 +30,7 @@ zero_song_structs_loop:
sta pt3_envelope_slide_add_h_smc+1 ; 4
sta pt3_envelope_add_smc+1 ; 4
sta pt3_envelope_type_smc+1 ; 4
sta pt3_envelope_type_old_smc+1 ; 4
sta pt3_envelope_type_old_smc+1 ; ok as set_env always ; 4
sta pt3_envelope_delay_smc+1 ; 4
sta pt3_envelope_delay_orig_smc+1 ; 4
@ -45,6 +45,8 @@ zero_song_structs_loop:
sta note_b+NOTE_VOLUME ; 4
sta note_c+NOTE_VOLUME ; 4
; default ornament/sample in A
; X is zero coming in here
;ldx #(NOTE_STRUCT_SIZE*0) ; 2

View File

@ -66,7 +66,7 @@ r4_smc:
; Register 5: C coarse
ldx #5 ; 2
r5_smc:
r13_smc:
lda $D400,Y ; 4+
pha ; 3
and #$f ; 2
@ -81,7 +81,7 @@ r5_smc:
lsr ; 2
lsr ; 2
r13_smc:
r5_smc:
ldx $D500,Y ; check for env update ; 4
bmi skip_envelope_write ; 3
;============
@ -274,12 +274,12 @@ update_pt3_play:
lda music_addr_table+3,Y ; 4
sta r4_smc+2 ; 4 ; D3
lda music_addr_table+5,Y ; 4
sta r5_smc+2 ; 4 ; D4
lda music_addr_table+4,Y ; 4
sta r13_smc+2 ; 4 ; D4
lda music_addr_table+4,Y ; 4 ; D5
sta r6_smc+2 ; 4
sta r13_smc+2 ; 4 ; D5
lda music_addr_table+5,Y ; 4
sta r5_smc+2 ; 4 ; D5
sta r6_smc+2 ; 4 ; D5
lda music_addr_table+6,Y ; 4 ; D6
sta r7_smc+2 ; 4

View File

@ -55,7 +55,7 @@ r4_wrsmc:
; Register 5: Envelope Shape [top] / C coarse [bottom]
lda C_COARSE_TONE
and #$f
sta C_COARSE_TONE
sta C_COARSE_TEMP
lda ENVELOPE_SHAPE
cmp #$ff
@ -67,19 +67,17 @@ yes_envelope:
asl
asl
asl
ora C_COARSE_TONE
sta C_COARSE_TONE
ora C_COARSE_TEMP
sta C_COARSE_TEMP
lda #0
sta ENVELOPE_SHAPE
jmp done_envelope
no_envelope:
lda #$80
sta ENVELOPE_SHAPE
done_envelope:
sta ENV_SHAPE_TEMP
lda C_COARSE_TONE
lda C_COARSE_TEMP
r13_wrsmc:
sta $D400,Y
@ -88,7 +86,7 @@ r13_wrsmc:
; Register 6: Noise
lda NOISE
and #$1f
ora ENVELOPE_SHAPE
ora ENV_SHAPE_TEMP
r6_wrsmc:
sta $D500,Y
@ -103,19 +101,19 @@ r7_wrsmc:
lda A_VOLUME
and #$1f
sta A_VOLUME
sta A_VOL_TEMP
lda B_VOLUME
and #$10
asl
ora A_VOLUME
sta A_VOLUME
ora A_VOL_TEMP
sta A_VOL_TEMP
lda C_VOLUME
and #$10
asl
asl
ora A_VOLUME
ora A_VOL_TEMP
r8_wrsmc:
sta $D700,Y
@ -124,14 +122,14 @@ r8_wrsmc:
lda B_VOLUME
and #$f
sta B_VOLUME
sta A_VOL_TEMP
lda C_VOLUME
asl
asl
asl
asl
ora B_VOLUME
ora A_VOL_TEMP
r9_wrsmc:
sta $D800,Y

View File

@ -88,6 +88,9 @@ MB_ADDRH = $87
DONE_PLAYING = $88
DONE_SONG = $89
PT3_TEMP = $8A
ENV_SHAPE_TEMP = $8B
C_COARSE_TEMP = $8C
A_VOL_TEMP = $8D
KEYPTRL = $90
KEYPTRH = $91