mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-08-15 08:27:41 +00:00
pt3: minor changes
This commit is contained in:
@@ -393,96 +393,87 @@ load_sample:
|
|||||||
; pt3_init_song
|
; pt3_init_song
|
||||||
;====================================
|
;====================================
|
||||||
;
|
;
|
||||||
|
; TODO: change to a memset type instruction?
|
||||||
|
|
||||||
pt3_init_song:
|
pt3_init_song:
|
||||||
lda #$f
|
lda #$f ; 2
|
||||||
sta note_a+NOTE_VOLUME
|
sta note_a+NOTE_VOLUME ; 4
|
||||||
sta note_b+NOTE_VOLUME
|
sta note_b+NOTE_VOLUME ; 4
|
||||||
sta note_c+NOTE_VOLUME
|
sta note_c+NOTE_VOLUME ; 4
|
||||||
|
|
||||||
lda #$0
|
lda #$0 ; 2
|
||||||
sta DONE_SONG
|
sta DONE_SONG ; 3
|
||||||
sta note_a+NOTE_TONE_SLIDING_L
|
sta note_a+NOTE_TONE_SLIDING_L ; 4
|
||||||
sta note_b+NOTE_TONE_SLIDING_L
|
sta note_b+NOTE_TONE_SLIDING_L ; 4
|
||||||
sta note_c+NOTE_TONE_SLIDING_L
|
sta note_c+NOTE_TONE_SLIDING_L ; 4
|
||||||
sta note_a+NOTE_TONE_SLIDING_H
|
sta note_a+NOTE_TONE_SLIDING_H ; 4
|
||||||
sta note_b+NOTE_TONE_SLIDING_H
|
sta note_b+NOTE_TONE_SLIDING_H ; 4
|
||||||
sta note_c+NOTE_TONE_SLIDING_H
|
sta note_c+NOTE_TONE_SLIDING_H ; 4
|
||||||
sta note_a+NOTE_ENABLED
|
sta note_a+NOTE_ENABLED ; 4
|
||||||
sta note_b+NOTE_ENABLED
|
sta note_b+NOTE_ENABLED ; 4
|
||||||
sta note_c+NOTE_ENABLED
|
sta note_c+NOTE_ENABLED ; 4
|
||||||
sta note_a+NOTE_ENVELOPE_ENABLED
|
sta note_a+NOTE_ENVELOPE_ENABLED ; 4
|
||||||
sta note_b+NOTE_ENVELOPE_ENABLED
|
sta note_b+NOTE_ENVELOPE_ENABLED ; 4
|
||||||
sta note_c+NOTE_ENVELOPE_ENABLED
|
sta note_c+NOTE_ENVELOPE_ENABLED ; 4
|
||||||
|
|
||||||
|
sta pt3_noise_period ; 4
|
||||||
|
sta pt3_noise_add ; 4
|
||||||
|
sta pt3_envelope_period_l ; 4
|
||||||
|
sta pt3_envelope_period_h ; 4
|
||||||
|
sta pt3_envelope_type ; 4
|
||||||
|
|
||||||
; default ornament/sample in A
|
; default ornament/sample in A
|
||||||
lda #0
|
lda #0 ; 2
|
||||||
ldx #(NOTE_STRUCT_SIZE*0)
|
ldx #(NOTE_STRUCT_SIZE*0) ; 2
|
||||||
jsr load_ornament
|
jsr load_ornament ; 6+86
|
||||||
lda #1
|
lda #1 ; 2
|
||||||
jsr load_sample
|
jsr load_sample ; 6+86
|
||||||
|
|
||||||
; default ornament/sample in B
|
; default ornament/sample in B
|
||||||
lda #0
|
lda #0 ; 2
|
||||||
ldx #(NOTE_STRUCT_SIZE*1)
|
ldx #(NOTE_STRUCT_SIZE*1) ; 2
|
||||||
jsr load_ornament
|
jsr load_ornament ; 6+86
|
||||||
lda #1
|
lda #1 ; 2
|
||||||
jsr load_sample
|
jsr load_sample ; 6+86
|
||||||
|
|
||||||
; default ornament/sample in C
|
; default ornament/sample in C
|
||||||
lda #0
|
lda #0 ; 2
|
||||||
ldx #(NOTE_STRUCT_SIZE*2)
|
ldx #(NOTE_STRUCT_SIZE*2) ; 2
|
||||||
jsr load_ornament
|
jsr load_ornament ; 6+86
|
||||||
lda #1
|
lda #1 ; 2
|
||||||
jsr load_sample
|
jsr load_sample ; 6+86
|
||||||
|
|
||||||
lda #$0
|
|
||||||
sta pt3_noise_period
|
|
||||||
sta pt3_noise_add
|
|
||||||
sta pt3_envelope_period_l
|
|
||||||
sta pt3_envelope_period_h
|
|
||||||
sta pt3_envelope_type
|
|
||||||
|
|
||||||
;============================
|
|
||||||
; calculate patterns in song
|
|
||||||
; FIXME: is this necessary? can just end when we hit FF playing?
|
|
||||||
; ldy #0
|
|
||||||
;length_loop:
|
|
||||||
; lda PT3_LOC+PT3_PATTERN_TABLE,Y
|
|
||||||
; iny
|
|
||||||
; cmp #$ff
|
|
||||||
; bne length_loop
|
|
||||||
|
|
||||||
; sty pt3_music_len
|
|
||||||
|
|
||||||
;======================
|
;======================
|
||||||
; calculate version
|
; calculate version
|
||||||
lda #6
|
lda #6 ; 2
|
||||||
sta pt3_version
|
sta pt3_version ; 3
|
||||||
lda PT3_LOC+PT3_VERSION
|
lda PT3_LOC+PT3_VERSION ; 4
|
||||||
cmp #'0'
|
cmp #'0' ; 2
|
||||||
bcc not_ascii_number ; blt
|
bcc not_ascii_number ; blt ; 2/3
|
||||||
cmp #'9'
|
cmp #'9' ; 2
|
||||||
bcs not_ascii_number ; bge
|
bcs not_ascii_number ; bge ; 2/3
|
||||||
sec
|
sec ; 2
|
||||||
sbc #'0'
|
sbc #'0' ; 2
|
||||||
sta pt3_version
|
sta pt3_version ; 4
|
||||||
|
|
||||||
not_ascii_number:
|
not_ascii_number:
|
||||||
|
|
||||||
;=======================
|
;=======================
|
||||||
; load default speed
|
; load default speed
|
||||||
|
; FIXME: change to self-modifying code
|
||||||
|
|
||||||
lda PT3_LOC+PT3_SPEED
|
lda PT3_LOC+PT3_SPEED ; 4
|
||||||
sta pt3_speed
|
sta pt3_speed ; 4
|
||||||
|
|
||||||
;=======================
|
;=======================
|
||||||
; load default speed
|
; load loop
|
||||||
|
; FIXME: change to self-modifying code
|
||||||
|
|
||||||
lda PT3_LOC+PT3_LOOP
|
lda PT3_LOC+PT3_LOOP ; 4
|
||||||
sta pt3_loop
|
sta pt3_loop ; 4
|
||||||
|
|
||||||
rts
|
rts ; 6
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -492,10 +483,6 @@ not_ascii_number:
|
|||||||
e_slide_amount: .byte $0
|
e_slide_amount: .byte $0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;=====================================
|
;=====================================
|
||||||
; Calculate Note
|
; Calculate Note
|
||||||
;=====================================
|
;=====================================
|
||||||
@@ -1723,9 +1710,6 @@ not_done:
|
|||||||
|
|
||||||
lda #0
|
lda #0
|
||||||
sta pt3_noise_period
|
sta pt3_noise_period
|
||||||
; sta note_a+NOTE_ALL_DONE
|
|
||||||
; sta note_b+NOTE_ALL_DONE
|
|
||||||
; sta note_c+NOTE_ALL_DONE
|
|
||||||
|
|
||||||
lda #3 ; FIXME: num_channels
|
lda #3 ; FIXME: num_channels
|
||||||
sta pt3_pattern_done
|
sta pt3_pattern_done
|
||||||
@@ -1816,8 +1800,8 @@ do_frame:
|
|||||||
; R0/R1 = A period low/high
|
; R0/R1 = A period low/high
|
||||||
; R2/R3 = B period low/high
|
; R2/R3 = B period low/high
|
||||||
; R4/R5 = C period low/high
|
; R4/R5 = C period low/high
|
||||||
; R6 = Noise period */
|
; R6 = Noise period
|
||||||
; R7 = Enable XX Noise=!CBA Tone=!CBA */
|
; R7 = Enable XX Noise=!CBA Tone=!CBA
|
||||||
; R8/R9/R10 = Channel A/B/C amplitude M3210, M=envelope enable
|
; R8/R9/R10 = Channel A/B/C amplitude M3210, M=envelope enable
|
||||||
; R11/R12 = Envelope Period low/high
|
; R11/R12 = Envelope Period low/high
|
||||||
; R13 = Envelope Shape, 0xff means don't write
|
; R13 = Envelope Shape, 0xff means don't write
|
||||||
|
Reference in New Issue
Block a user