mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-09-13 12:56:30 +00:00
pt3: a lot of decoding is done
This commit is contained in:
parent
d4fdeb27ea
commit
2668b01f28
@ -472,48 +472,84 @@ note_decode_loop:
|
|||||||
bne decode_case_1X
|
bne decode_case_1X
|
||||||
|
|
||||||
decode_case_0X:
|
decode_case_0X:
|
||||||
; if (current_val==0x0) {
|
;==============================
|
||||||
; a->len_count=0;
|
; $0X set special effect
|
||||||
; a->all_done=1;
|
;==============================
|
||||||
; a_done=1;
|
|
||||||
; }
|
txa
|
||||||
; else { /* FIXME: what if multiple spec commands? */
|
and #$f
|
||||||
; /* Doesn't seem to happen in practice */
|
|
||||||
; /* But AY_emul has code to handle it */
|
bne decode_case_0X_not_zero
|
||||||
; a->spec_command=current_val&0xf;
|
|
||||||
; }
|
; Do we ever actually hit this case?
|
||||||
|
|
||||||
|
sta note_a+NOTE_LEN_COUNT ; len_count=0;
|
||||||
|
|
||||||
|
lda #1
|
||||||
|
sta note_a+NOTE_ALL_DONE
|
||||||
|
sta decode_done
|
||||||
|
|
||||||
|
jmp done_decode
|
||||||
|
|
||||||
|
decode_case_0X_not_zero:
|
||||||
|
|
||||||
|
; FIXME: what if multiple spec commands?
|
||||||
|
; Doesn't seem to happen in practice
|
||||||
|
; But AY_emul has code to handle it
|
||||||
|
|
||||||
|
sta note_a+NOTE_SPEC_COMMAND
|
||||||
|
|
||||||
jmp done_decode
|
jmp done_decode
|
||||||
|
|
||||||
decode_case_1X:
|
decode_case_1X:
|
||||||
|
;==============================
|
||||||
|
; $1X -- Set Envelope Type
|
||||||
|
;==============================
|
||||||
|
|
||||||
cmp #$10
|
cmp #$10
|
||||||
bne decode_case_2X
|
bne decode_case_2X
|
||||||
|
|
||||||
; if ((current_val&0xf)==0x0) {
|
txa
|
||||||
; a->envelope_enabled=0;
|
and #$0f
|
||||||
; }
|
bne decode_case_not_10
|
||||||
; else {
|
|
||||||
; pt3->envelope_type_old=0x78;
|
|
||||||
; pt3->envelope_type=(current_val&0xf);
|
|
||||||
|
|
||||||
; (*addr)++;
|
decode_case_10:
|
||||||
; current_val=pt3->data[*addr];
|
sta note_a+NOTE_ENVELOPE_ENABLED
|
||||||
; pt3->envelope_period=(current_val<<8);
|
jmp decode_case_1x_common
|
||||||
|
|
||||||
; (*addr)++;
|
|
||||||
|
|
||||||
; current_val=pt3->data[(*addr)];
|
decode_case_not_10:
|
||||||
; pt3->envelope_period|=(current_val&0xff$
|
; Needed?
|
||||||
|
; FIXME: combine this with the BX code somehow?
|
||||||
|
; pt3->envelope_type_old=0x78;
|
||||||
|
|
||||||
; a->envelope_enabled=1;
|
sta pt3_envelope_type
|
||||||
; pt3->envelope_slide=0;
|
|
||||||
; pt3->envelope_delay=0;
|
|
||||||
; }
|
|
||||||
; (*addr)++;
|
|
||||||
; current_val=pt3->data[(*addr)];
|
|
||||||
; a->sample=(current_val/2);
|
|
||||||
; pt3_load_sample(pt3,a->which);
|
|
||||||
|
|
||||||
; a->ornament_position=0;
|
; get next byte
|
||||||
|
iny
|
||||||
|
lda (PATTERN_L),Y
|
||||||
|
sta pt3_envelope_period_h
|
||||||
|
|
||||||
|
iny
|
||||||
|
lda (PATTERN_L),Y
|
||||||
|
sta pt3_envelope_period_l
|
||||||
|
|
||||||
|
lda #0
|
||||||
|
sta pt3_envelope_delay ; envelope_delay=0
|
||||||
|
sta pt3_envelope_slide_l ; envelope_slide=0
|
||||||
|
sta pt3_envelope_slide_h
|
||||||
|
lda #1
|
||||||
|
sta note_a+NOTE_ENVELOPE_ENABLED ; envelope_enabled=1
|
||||||
|
|
||||||
|
decode_case_1x_common:
|
||||||
|
|
||||||
|
iny ; FIXME: combine?
|
||||||
|
lda (PATTERN_L),Y
|
||||||
|
lsr
|
||||||
|
jsr load_sample
|
||||||
|
|
||||||
|
lda #0
|
||||||
|
sta note_a+NOTE_ORNAMENT_POSITION ; ornament_position=0
|
||||||
|
|
||||||
jmp done_decode
|
jmp done_decode
|
||||||
|
|
||||||
@ -599,33 +635,59 @@ decode_case_bX:
|
|||||||
cmp #$b0
|
cmp #$b0
|
||||||
bne decode_case_cX
|
bne decode_case_cX
|
||||||
|
|
||||||
|
txa
|
||||||
|
and #$f
|
||||||
|
beq decode_case_b0
|
||||||
|
cmp #1
|
||||||
|
beq decode_case_b1
|
||||||
|
jmp decode_case_bx_higher
|
||||||
|
|
||||||
; /* Disable envelope */
|
decode_case_b0:
|
||||||
; if (current_val==0xb0) {
|
; Disable envelope
|
||||||
; a->envelope_enabled=0;
|
lda #0
|
||||||
; a->ornament_position=0;
|
sta note_a+NOTE_ENVELOPE_ENABLED
|
||||||
; }
|
sta note_a+NOTE_ORNAMENT_POSITION
|
||||||
; /* set len */
|
jmp done_decode
|
||||||
; else if (current_val==0xb1) {
|
|
||||||
; (*addr)++;
|
|
||||||
; current_val=pt3->data[(*addr)];
|
decode_case_b1:
|
||||||
; a->len=current_val;
|
; Set Length
|
||||||
; a->len_count=a->len;
|
|
||||||
; }
|
; get next byte
|
||||||
; else {
|
iny
|
||||||
; a->envelope_enabled=1;
|
lda (PATTERN_L),Y
|
||||||
; pt3->envelope_type_old=0x78;
|
|
||||||
; pt3->envelope_type=(current_val&0xf)-1;
|
sta note_a+NOTE_LEN
|
||||||
; (*addr)++;
|
sta note_a+NOTE_LEN_COUNT
|
||||||
; current_val=pt3->data[(*addr)];
|
jmp done_decode
|
||||||
; pt3->envelope_period=(current_val<<8);
|
|
||||||
; (*addr)++;
|
decode_case_bx_higher:
|
||||||
; current_val=pt3->data[(*addr)];
|
|
||||||
; pt3->envelope_period|=(current_val&0xff$
|
; give fake old to force update? maybe only needed if printing?
|
||||||
; a->ornament_position=0;
|
; pt3->envelope_type_old=0x78;
|
||||||
; pt3->envelope_slide=0;
|
|
||||||
; pt3->envelope_delay=0;
|
sec
|
||||||
; }
|
sbc #1
|
||||||
|
sta pt3_envelope_type ; envelope_type=(current_val&0xf)-1;
|
||||||
|
|
||||||
|
; get next byte
|
||||||
|
iny
|
||||||
|
lda (PATTERN_L),Y
|
||||||
|
sta pt3_envelope_period_h
|
||||||
|
|
||||||
|
; get next byte
|
||||||
|
iny
|
||||||
|
lda (PATTERN_L),Y
|
||||||
|
sta pt3_envelope_period_l
|
||||||
|
|
||||||
|
lda #0
|
||||||
|
sta note_a+NOTE_ORNAMENT_POSITION ; ornament_position=0
|
||||||
|
sta pt3_envelope_slide_l ; envelope_slide=0
|
||||||
|
sta pt3_envelope_slide_h
|
||||||
|
sta pt3_envelope_delay ; envelope_delay=0
|
||||||
|
|
||||||
|
lda #1
|
||||||
|
sta note_a+NOTE_ENVELOPE_ENABLED ; envelope_enabled=1;
|
||||||
jmp done_decode
|
jmp done_decode
|
||||||
|
|
||||||
decode_case_cX:
|
decode_case_cX:
|
||||||
|
Loading…
Reference in New Issue
Block a user