Hello all User's MSX of the World,
Under here, I have a routine in assembler for sound effect, but unfortunately do not work!
because inside the routine missing CALL 93$ for call bios SOUND and then missing also
the DATA here ----->
CHN_DATA: ; All data for channels
Example of a routine in assembler for SOUND FX
org $c000 - 7 .db $fe .dw startProgram,endProgram,startProgram startProgram: SET_SOUND: ; Prepare a channel to reproduce a note with a sample and ornament ; Parameters: A=channel number (0=A,1=B,2=C) ; B=ornamente index | sample index ; C=note ;-------------------------------------------------------------------------- ; Obtain channel pointer add a,a add a,e ld e,a add a,a ld a,e ld d,0 ld hl,CHN_DATA add hl,de push hl ; Obtain sample pointer ld a,b and $1F add a,e ld e,a ld hl,SMP_TABLE add hl,de ld e,(hl) inc hl ld d,(hl) pop hl ld (hl),e inc hl ld (hl),d inc hl ; Obtain ornament pointer push hl ld a,b rlca rlca rlca and $7 add a,a ld hl,ORN_TABLE ld e,a ld d,0 add hl,de ld e,(hl) inc hl ld d,(hl) pop hl ld (hl),e inc hl ld (hl),d inc hl ; Store note ld (hl),c ; Initialize frequency shift inc hl xor a ld (hl),a inc hl ld (hl),a ; Note and sample installed in the channel ret CHN_DATA: ; All data for channels ; Sample table SMP_TABLE: .dw SMP_ID_0,SMP_ID_1,SMP_ID_2,SMP_ID_3 ; Silence sample SMP_ID_0: .db $00,$00,$80,$01 ; User-defined samples SMP_ID_1: .db $0F,$80,$0F,$80,$0F,$80,$0F,$80,$0E,$80,$0E,$80,$0D,$80,$0C,$80 .db $0B,$80,$0A,$80,$0A,$80,$0B,$80,$0B,$80,$0C,$80,$0C,$80,$0B,$80 .db $0A,$80,$80,$05 SMP_ID_2: .db $0D,$A1,$80,$01 SMP_ID_3: .db $4F,$40,$7F,$40,$9F,$40,$BE,$40,$CE,$40,$CD,$40,$C8,$40,$00,$00 .db $80,$01 ; Ornament table ORN_TABLE: .dw ORN_ID_0,ORN_ID_1 ; Null ornament ORN_ID_0: .db $00,$80,$01 ; User-defined ornaments ORN_ID_1: .db $01,$00,$FF,$00,$80,$04 endProgram: .end
Could you help me to make this assembler routine work
well to generate a sound effect, please?
For now is all.....
Thanks in advance
Best Regards
(^_^)
AG Italy
ログイン/登録して投稿